const mog = require('../connect')
const moment = require('moment')
let notes = mog.Schema({
    title: {
        type: String,
        required: true
    },
    content: {
        type: String,
        required: true
    },
    author: {
        type: String,
        required: false
    },
    time: {
        type: Date,
        require: true,
        default: () => moment().format('YYYY-MM-DD HH:mm:ss')
    }
})


const noteModel = mog.model('notes', notes)


module.exports = noteModel